<div class="full_w">
    <div class="h_title"><?php echo Yii::t('AdmincpModule.admincp', 'Add Item'); ?></div>
    <?php 
        foreach(Yii::app()->admin->getFlashes() as $key => $message){
            echo '<div class="n_'.$key.'"><p>'.$message."</p></div>\n";
        }
    ?>
    <form action="" method="post" id="frmUser">
     	<div class="element">
            <label>Title<span class="red">*</span></label> 
            <input type="text" name="item[item_title]" id="item_title" class="text required autoGeneratedTarget" value="<?php echo isset($arrItemInfo['item_code'])?$arrItemInfo['item_code']:null; ?>" autocomplete="off">
        </div>
    	<div class="element">
            <label>Link <span class="red">*</span></label>
            <input type="text" name="item[item_link]" id="item_link" class="text required autoGeneratedSource" value="<?php echo isset($arrItemInfo['item_title'])?$arrItemInfo['item_title']:null; ?>" autocomplete="off">
        </div>
        
        <div class="element">
            <label>Description</label>
            <textarea class="textarea" name="item[item_description]" id="item_description"><?php echo isset($arrItemInfo['item_description'])?$arrItemInfo['item_description']:null; ?></textarea>
        </div>  
        <div class="element">
            <label>Parent</label>
            <select name="item[item_parent]" id="parent">
                <option value="">-- select category</option>
                <?php foreach($arrMenuItems as $R): ?>
                <option value="<?php echo $R['item_id']; ?>" <?php if(isset($arrItemInfo['item_parent']) && $R['item_id'] == $arrItemInfo['item_parent']): ?>selected<?php endif; ?>>
                    <?php for($i=0; $i<$R['item_level']; $i++): echo '&nbsp;&nbsp;&nbsp;'; endfor; ?>
					<?php echo $R['item_title']; ?>
                </option>
                <?php endforeach; ?>
            </select>
        </div>     
        <div class="element">
            <label>Status</label>
            <select name="item[item_status]" id="item_status">
            	<option value="0">Inactive</option>
                <option value="1" <?php if(isset($arrItemInfo['item_status']) && $arrItemInfo['item_status'] == '1'): ?>selected<?php endif; ?>>Active</option>
            </select>
        </div>     
        <div class="entry">
         	<input type="hidden" name="item[menu_id]" id="menu" value="<?php echo $intMenuId; ?>">
            <input type="hidden" name="id" id="id" value="<?php echo isset($arrItemInfo['item_id'])?$arrItemInfo['item_id']:null; ?>">
            <button type="submit">Submit</button> <button>Cancel</button>
        </div>
    </form>
</div>